package com.zh.note.huawei.twohundred.排队游戏;

/**
 * @Author: zhanghuan
 * @date: 2023/9/7 17:47
 * @description: create it
 */

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();  // 班级总人数
        int m = sc.nextInt();  // 刺头人数
        int k = sc.nextInt();  // 最大不满程度

        HashSet<Integer> troublemaker = new HashSet<>();
        for (int i = 0; i < m; i++) {
            troublemaker.add(sc.nextInt());  // 刺头所在位置
        }

        List<Integer> abilities = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            int ability = sc.nextInt();  // 当前学生能力
            abilities.add(ability);
        }

        int dissatisfaction = 0;  // 总满意程度

        for (int i = 0; i < n; i++) {
            if (troublemaker.contains(i)) {
                int higherCount = countHigher(abilities, i);
                dissatisfaction += higherCount;
            } else {
                int lowerCount = countLower(abilities, i);
                dissatisfaction += Math.max(0, i - lowerCount);
            }
        }

        System.out.println(dissatisfaction > k ? 1 : 0);
    }

    public static int countHigher(List<Integer> abilities, int index) {
        int count = 0;
        for (int i = index + 1; i < abilities.size(); i++) {
            if (abilities.get(i) > abilities.get(index)) {
                count++;
            } else {
                break; // 遇到能力不再更高的学生时，停止计数
            }
        }
        return count;
    }

    public static int countLower(List<Integer> abilities, int index) {
        int count = 0;
        for (int i = index - 1; i >= 0; i--) {
            if (abilities.get(i) < abilities.get(index)) {
                count++;
            } else {
                break; // 遇到能力不再更低的学生时，停止计数
            }
        }
        return count;
    }
}

